/**
 * 
 */
package fr.univ_tln.inf9.exaplanning.controleur.composante;

import java.util.List;

import fr.univ_tln.inf9.exaplanning.api.composante.*;



/**
 * @author ventura
 *
 */
public class ComponentController {

public ComponentView listView = null;
	
	private Component r = null;
	
	public ComponentController (Component r){
		this.r = r;
		
		//listView = new JFrameListMaterial(this, r.getEquipment(),r.getId());
		
		addToListTraining_pathListener();
		addToListAdminListener();
		
		}


	private void addToListTraining_pathListener() {
		r.addListTraining_pathListener(listView);		
	}

	private void addToListAdminListener() {
		r.addAdminListener(listView);		
	}

	public void displayViews(){
		listView.display();
	}
	
	public void closeViews(){
		listView.close();
	}
	
	/*public void notifyListTraining_pathChanged(List<String> mat){
		r.setTraining_path(mat);;
	}*/
	
	public void notifyTraining_pathAddedToList(TrainingPath m){
		r.addTraining_path(m);
	}
	
	
	public void notifyTraining_pathRemovedToList(String nameM){
		r.removeTraining_path(nameM);
	}
}
